package henu.innovation.mapper;

import henu.innovation.entity.Exam;
import henu.innovation.entity.Student;
import henu.innovation.entity.Teacher;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public interface TeacherMapper {
    //通过昵称，口令登录
    public Teacher TeacherSignIn(@Param("name") String name, @Param("password") String password);
    //获取相应考试的学生信息

    //修改登录口令
    Boolean TeacherPasswordChanged(Teacher teacher);
    //通过id找对象
    Teacher FindTeacherById(@Param("id")int id);

    //增
    boolean addTeacher(Teacher teacher);
    //删
    boolean deleteTeacherById(@Param("id")int id);
    //查询所有
    List<Teacher> findAllTeachers();
    //改
    boolean updateTeacher(Teacher teacher);
    //添加考试
   // Exam teacherAddExam(@Param("ename")String name,@Param("etime")String startime,@Param("eautostart")Boolean autostart);
    Boolean teacherAddExam(Exam exam);
    //通过id查询考试
    Exam teacherFindExamById(@Param("id")int id);
    //老师查询所有考试
    List<Exam> showAllExamsByCreator(@Param("creator")String creator);
    //查询所有考试
    List<Exam> showAllExams();
    //删除考试
    boolean deleteExamById(@Param("id")int id);


    //按表格批量添加学生
    boolean excelUpload(String name, MultipartFile file);
    //添加单个学生
   // Boolean teacherAddStudent(@Param("sno")String number,@Param("sname")String name,@Param("sclass")String clazz);
    Boolean teacherAddStudent(Student student);
    //查找学生
    Student teacherFindStudent(@Param("sno")String number,@Param("sname")String name,@Param("sclass")String clazz);
    //查找学生通过ip
    Student teacherFindStudentByIp(@Param("ip")String ipbinding);



}
